/**
 * @Description: TODO
 * @author LQL
 * @date 2020年3月14日
 */
package com.qqt.csr.common.vo.resp;

import com.qqt.csr.common.exception.StatusCode;
import com.qqt.csr.common.utils.DateUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.io.Serial;
import java.io.Serializable;

/**
 * 请求响应基类
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ToString
@Schema(description = "响应基础类参数")
public class BaseResponse implements Serializable {
	@Serial
	private static final long serialVersionUID = 6179074138014309170L;
	@Schema(description = "状态码", requiredMode = Schema.RequiredMode.REQUIRED)
	private Integer code = 200;

	@Schema(description = "提示信息", requiredMode = Schema.RequiredMode.REQUIRED)
	private String message = "SUCCESS";

	@Schema(description = "响应时间", requiredMode = Schema.RequiredMode.REQUIRED)
	private String timestamp = DateUtil.getDate_ymdhms();

	public boolean isSuccess() {
		return code != null && code.equals(StatusCode.OK);
	}

}
